<template>
  <div class="pageBox">
    <div class="outListBox">
      <div
        class="outListBox-listItem"
        v-for="(item, index) in vouchersList"
        :key="index"
      >
        <div class="outListBox-listItem-head">
          <img :src="item.rpImgUrl" alt="" />
        </div>
        <div class="outListBox-listItem-body">
          <div class="outListBox-listItem-body-text">{{ item.name }}</div>
          <div class="outListBox-listItem-body-num">
            <span>{{ item.score }}</span
            ><span>积分</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    vouchersList: {
      type: Array,
      default: [],
    },
    isLoginPhone: Boolean,
  },
  data() {
    return {};
  },
  methods: {
    giToDetail(row) {
      if (this.isLoginPhone) {
        const { id } = row;
        this.$router.push({
          path: "/detail",
          query: { id: id },
        });
      } else {
        this.$emit("logoPhone");
      }
    },
  },
};
</script>
<style lang="less" scoped>
.pageBox {
  height: 100%;
  width: 100%;
  padding: 0 10px;
  background: #f2f2f4;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none; /* firefox */

  -ms-overflow-style: none; /* IE 10+ */
  &::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }
}
.outListBox {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  box-sizing: border-box;

  &-listItem {
    flex: 0 0 48%;
    margin-bottom: 15px;
    box-sizing: border-box;
    box-shadow: 0px 46px 80px rgba(196, 196, 196, 0.07),
      0px 10.2747px 17.869px rgba(196, 196, 196, 0.0417275),
      0px 3.05905px 5.32008px rgba(196, 196, 196, 0.0282725);
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    &-head {
      img {
        width: 100%;
        height: 120px;
      }
    }
    &-body {
      padding: 12px;
      &-text {
        font-weight: 400;
        font-size: 14px;
        color: #39394d;
      }
      &-num {
        margin-top: 10px;
        color: #39394d;
        span:first-child {
          font-weight: 600;
          font-size: 14px;
        }
        span:last-child {
          font-weight: 400;
          font-size: 14px;
          margin-left: 4px;
        }
      }
    }
  }
}
</style>
